// Created by WXX on 2021/11/1 9:33
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

class Solution {
public:
    int distributeCandies(vector<int>& candyType) {
        int n = candyType.size();
        sort(candyType.begin(), candyType.end());
        candyType.erase(unique(candyType.begin(), candyType.end()), candyType.end());
        return min(n / 2, (int)candyType.size());
    }
};

int main() {

    vector<int> candyType = {1, 1, 2, 3};
    cout << Solution().distributeCandies(candyType) << endl;  // 2

    return 0;
}
